<?php
namespace Home\Controller;
use Think\Controller; 

//class首字母大写 方法名都小写
// Model View Controller
class LiyangController extends Controller {
	public function zhl(){
		//1.拿到上传数据
		$id = I("get.id");

		$msg_id = I("get.msg_id");
		$user_id = I("get.user_id");


		$aData = array();
		$aData['num'] = array('exp', 'num+1');
		M()->table('msg')->where('id=' . $msg_id).save($aData);

		$aRet = array();
		$aRet['errno'] = 0;
		$aRet['errmsg'] = "";
		$aRet['current_num'] = $num;
		$this->ajaxReturn($aRet);
		// I("cookie.") I("session.")
		//2.调用Model处理数据 查询数据库
		//数据库配置好

		//CRUD CREATE READ UPDATE DELETE
		//ORM-object-relation mapping
		// mysqli_query("select * from zj_user where id = 1");
		

		//find返回一条结果 select返回多条结果 
		//select username from zj_user where id >1 and id < 3
		

		

		//update zj_user set id = id + 1 where id = 12;
		// $aWhere = array(
		// 	'id' => $id,
		// );
		// $aUserInfo = M()->table('zj_user')->where($aWhere)->find();
		//3.调用View或者直接返回结果
		//assign

		$aDisplay = array('关于ta们', '新闻资讯', '附加功能', '选号中心', '资费标准', '首页');

		//$this->assign('res', $aDisplay);

		//$pic_directory = $_SERVER['DOCUMENT_ROOT']
		$pic_directory = '/Public/images/';
		//$this->assign('userinfo', $pic_directory);
		//$this->display('ps');
		$this->display();//返回一个html
		//app 微信小程序 ajax
		$this->ajaxReturn(array(1,2,3,4,5));
	}
}

//zj_user id username password